/// <reference path="../../Geo.Core.ts" />
/// <reference path="../Geo.Core.Mocks.ts" />
/// <reference path="../qunit.d.ts" />

// ok(true, "this test is fine");
//var actualValue = "hello";

test("NavigationController QueryStringNavigationProvider GoToAction", function () {
    var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Action.html?c=123456';
    navigation.GoToAction();
    equal(actualValue, expectedResult, "NavigationController GoToAction:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/Action.html?c=abcdef';
    navigation.GoToAction('abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToAction:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Action.html?c=123456';
    navigation.GoToAction();
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToAction:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/Action.html?c=abcdef';
    navigation.GoToAction('abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToAction:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider GoToView", function () {
      var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/GoToView.html?c=123456';
    navigation.GoToView();
    equal(actualValue, expectedResult, "NavigationController GoToView:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/GoToView.html?c=abcdef';
    navigation.GoToView('abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToView:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/GoToView.html?c=123456';
    navigation.GoToView();
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToView:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/GoToView.html?c=abcdef';
    navigation.GoToView('abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToView:" + actualValue);
});


test("NavigationController QueryStringNavigationProvider GoToActionDetail DropOff", function () {
    var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/ActionDetail.html?c=123456&at=2';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToActionDetail DropOff:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/ActionDetail.html?c=abcdef&at=2';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToActionDetail GoToActionDetail DropOff:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/ActionDetail.html?c=123456&at=2';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToActionDetail GoToActionDetail DropOff:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/ActionDetail.html?c=abcdef&at=2';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff,'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToActionDetail GoToActionDetail DropOff:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider  GoToActionDetail PickUp", function () {
    var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/ActionDetail.html?c=123456&at=1';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController  GoToActionDetail PickUp:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/ActionDetail.html?c=abcdef&at=1';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef  GoToActionDetail PickUp:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/ActionDetail.html?c=123456&at=1';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToActionDetail PickUp:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/ActionDetail.html?c=abcdef&at=1';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef  GoToActionDetail PickUp:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider GoToUser DropOff", function () {
      var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/User.html?c=123456&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToUser DropOff:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/User.html?c=abcdef&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToUser DropOff:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/User.html?c=123456&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToUser DropOff:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/User.html?c=abcdef&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToUser DropOff:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider GoToLocation DropOff", function () {
   var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Location.html?c=123456&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToLocation DropOff:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/Location.html?c=abcdef&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToLocation DropOff:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Location.html?c=123456&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToLocation DropOff:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/Location.html?c=abcdef&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff,'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToLocation DropOff:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider GoToGeocache DropOff", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Geocache.html?c=123456&at=2';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToGeocache DropOff:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/Geocache.html?c=abcdef&at=2';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToGeocache DropOff:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Geocache.html?c=123456&at=2';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToGeocache DropOff:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/Geocache.html?c=abcdef&at=2';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToGeocache DropOff:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider GoToUser DropOff", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/User.html?c=123456&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToUser DropOff:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/User.html?c=abcdef&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToUser DropOff:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/User.html?c=123456&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToUser DropOff:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/User.html?c=abcdef&at=2';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToUser DropOff:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider GoToLocation DropOff", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Location.html?c=123456&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToLocation DropOff:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/Location.html?c=abcdef&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff,'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToLocation DropOff:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Location.html?c=123456&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToLocation DropOff:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/Location.html?c=abcdef&at=2';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToLocation DropOff:" + actualValue);
});

test("NavigationController QueryStringNavigationProvider GoToGeocache PickUp", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.QueryStringNavigationProvider(func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Geocache.html?c=123456&at=1';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController GoToGeocache PickUp:" + actualValue);
    
    //en override
    expectedResult = '/en/trackable/Geocache.html?c=abcdef&at=1';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToGeocache PickUp:" + actualValue);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Geocache.html?c=123456&at=1';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToGeocache PickUp:" + actualValue);
    
    //es override
    expectedResult = '/es/trackable/Geocache.html?c=abcdef&at=1';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp,'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToGeocache PickUp:" + actualValue);
});

test("NavigationController SessionNavigationProvider GoToAction", function () {
    var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(), func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Action.html';
    navigation.GoToAction();
    equal(actualValue, expectedResult, "NavigationController GoToAction:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  
    //en override
    expectedResult = '/en/trackable/Action.html';
    navigation.GoToAction('abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToAction:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Action.html';
    navigation.GoToAction();
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToAction:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/Action.html';
    navigation.GoToAction('abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToAction:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
 });

test("NavigationController SessionNavigationProvider GoToView", function () {
      var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/GoToView.html';
    navigation.GoToView();
    equal(actualValue, expectedResult, "NavigationController GoToView:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/GoToView.html';
    navigation.GoToView('abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToView:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/GoToView.html';
    navigation.GoToView();
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToView:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/GoToView.html';
    navigation.GoToView('abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToView:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
 });


test("NavigationController SessionNavigationProvider GoToActionDetail PickUp", function () {
    var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController GoToActionDetail PickUp:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp,'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToActionDetail PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToActionDetail PickUp:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.PickUp, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToActionDetail PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  });

test("NavigationController SessionNavigationProvider GoToActionDetail DropOff", function () {
    var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(), func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToActionDetail DropOff:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToActionDetail DropOff:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
     
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToActionDetail DropOff:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/ActionDetail.html';
    navigation.GoToActionDetail(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToActionDetail DropOff:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  
});

test("NavigationController SessionNavigationProvider GoToUser DropOff", function () {
      var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToUser DropOff:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToUser DropOff:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
     
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToUser DropOff:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToUser DropOff:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
 });

test("NavigationController SessionNavigationProvider LeftAtLocation", function () {
   var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToLocation:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToLocation:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToLocation:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.DropOff,'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToLocation:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
 });

test("NavigationController SessionNavigationProvider GoToGeocache DropOff", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController GoToGeocache DropOff:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToGeocache DropOff:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
    
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToGeocache DropOff:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.DropOff, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToGeocache DropOff:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
});

test("NavigationController SessionNavigationProvider GoToUser PickUp", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController GoToUser PickUp:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.PickUp, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToUser PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToUser PickUp:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/User.html';
    navigation.GoToUser(Geo.Enumerations.ActionTypes.PickUp, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToUser PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  });

test("NavigationController SessionNavigationProvider GoToLocation PickUp", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController GoToLocation PickUp:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.PickUp,'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToLocation PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToLocation PickUp:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/Location.html';
    navigation.GoToLocation(Geo.Enumerations.ActionTypes.PickUp, 'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToLocation PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  });

test("NavigationController SessionNavigationProvider GoToGeocache PickUp", function () {
     var actualValue : string;
    var func : any = function(url){
            actualValue = url;
        };
    var code : Geo.Interfaces.IPrivateKey = new Geo.Model.PrivateKeyInfo('123456');
    var navigationProvider : Geo.Interfaces.INavigationProvider = new Geo.Controller.SessionNavigationProvider(new Geo.Controller.SessionNameValuePairs(),func);

    var language : string = 'en'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //en default
    var expectedResult : string = '/en/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController GoToGeocache:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //en override
    expectedResult = '/en/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp,'abcdef');
    equal(actualValue, expectedResult, "NavigationController en override abcdef GoToGeocache PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
  
    language = 'es'; 
    var navigation : Geo.Interfaces.INavigationController = new Geo.Controller.NavigationController(code, language, navigationProvider);
    //es default
    var expectedResult : string = '/es/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp);
    equal(actualValue, expectedResult, "NavigationController es default 123456 GoToGeocache PickUp:" + actualValue);
    equal(sessionStorage['c'], '123456', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
   
    //es override
    expectedResult = '/es/trackable/Geocache.html';
    navigation.GoToGeocache(Geo.Enumerations.ActionTypes.PickUp,'abcdef');
    equal(actualValue, expectedResult, "NavigationController es override abcdef GoToGeocache PickUp:" + actualValue);
    equal(sessionStorage['c'], 'abcdef', "SessionNavigationProvider VALUE: " + sessionStorage['c']);
});

test("LocalStorageLogEntryRepository GetList/Add Empty", function () {
    var localStorageLogEntryRepository = new Geo.Repositories.LocalStorageLogEntryRepository();
    localStorageLogEntryRepository.Clear();
    var logEntry1: Geo.Interfaces.ILogEntry = localStorageLogEntryRepository.Add(new Geo.Model.PrivateKeyInfo('111111'),null,
        null,
        null,
        null,
        null);

    var logEntryList: Geo.Interfaces.ILogEntry[] = localStorageLogEntryRepository.GetList();
    ok(logEntryList[0].LogEntryLid >= 1, "length:" + logEntryList.length);
    equal(logEntryList[0].PrivateKey, '111111', "ActionType:" + logEntryList[0].PrivateKey);
    equal(logEntryList[0].ActionType, null, "ActionType:" + logEntryList[0].ActionType);
    equal(logEntryList[0].CacheCode, null, "CacheCode:" + logEntryList[0].CacheCode);
    equal(logEntryList[0].CacheSiteType, null, "CacheSiteType:" + logEntryList[0].CacheSiteType);
    equal(logEntryList[0].Coordinates, null, "Coordinates:" + logEntryList[0].Coordinates);
    ok(logEntryList[0].LogEntryLid >= 1, "LogEntryLid:" + logEntryList[0].LogEntryLid);
    equal(logEntryList[0].UserInteractedWith, null, "UserInteractedWith:" + logEntryList[0].UserInteractedWith);
});

test("LocalStorageLogEntryRepository GetList/Add Empty/Remove", function () {
    var localStorageLogEntryRepository = new Geo.Repositories.LocalStorageLogEntryRepository();
    var logEntryListOriginal: Geo.Interfaces.ILogEntry[] = localStorageLogEntryRepository.GetList();
    var logEntryListOriginalLength: number = localStorageLogEntryRepository.Count();
    var logEntry1: Geo.Interfaces.ILogEntry = localStorageLogEntryRepository.Add(new Geo.Model.PrivateKeyInfo('111111'), null,
        null,
        null,
        null,
        null);
    ok(localStorageLogEntryRepository.Contains(logEntry1), "Add")
    equal(localStorageLogEntryRepository.Count(), logEntryListOriginalLength + 1, " After Add length:" + localStorageLogEntryRepository.Count());

    localStorageLogEntryRepository.Remove(logEntry1);
    ok(!localStorageLogEntryRepository.Contains(logEntry1), "Remove")
    equal(localStorageLogEntryRepository.Count(), logEntryListOriginalLength, " After Remove length:" + localStorageLogEntryRepository.Count());

});


test("LocalStorageLogEntryRepository Set GotFromGeocache", function () {
    var localStorageLogEntryRepository = new Geo.Repositories.LocalStorageLogEntryRepository();
    var logEntryListOriginal: Geo.Interfaces.ILogEntry[] = localStorageLogEntryRepository.GetList();
    var logEntryListOriginalLength: number = localStorageLogEntryRepository.Count();
    var logEntry1: Geo.Interfaces.ILogEntry = localStorageLogEntryRepository.Add(
        new Geo.Model.PrivateKeyInfo('GFG001'),
        Geo.Enumerations.ActionTypes.PickUp,
        Geo.Enumerations.GeoCacheSiteTypes.OpenCachingDotCom,
        'OC0001',
        null,
        null);

    equal(logEntry1.ActionType, Geo.Enumerations.ActionTypes.PickUp, " ActionType:" + logEntry1.ActionType);
    equal(logEntry1.CacheCode, 'OC0001', " CacheCode:" + logEntry1.CacheCode);
    equal(logEntry1.CacheSiteType, Geo.Enumerations.GeoCacheSiteTypes.OpenCachingDotCom, " CacheSiteType:" + logEntry1.CacheSiteType);
    equal(logEntry1.Coordinates, null, " Coordinates:" + logEntry1.Coordinates);
    equal(logEntry1.PrivateKey, 'GFG001', " PrivateKey:" + logEntry1.PrivateKey);
    equal(logEntry1.UserInteractedWith, null, " UserInteractedWith:" + null);

    //localStorageLogEntryRepository.Remove(logEntry1);
});
